const actions = {
    save({ commit }, user) {
        commit('SAVE', user);
    },
    read({ commit }) {
        commit('READ');
    },
    checkLogin({ commit, state }) {
        return new Promise(function(resolve, reject) {
            if (state.user.username.length > 0 && state.user.password.length > 0) {
                resolve(true);
            } else {
                resolve(false);
            }
        })
    },
    updateSelecteMenu({ commit, state }, p) {
        commit('UPDATE_SELECTE_MENU', p);
    },
    logout({ commit }) {
        commit('LOG_OUT');
    }
};



export default actions;